{$CLEO .qa}
{$USE CLEO+}
{$USE newOpcodes}
{$USE ini}

0000: NOP

script_name "PAYANQ"

// By ArtemQa146

repeat
wait 0
04ED: load_animation  "PedEventsMod"
until 04EE:   animation "PedEventsMod" loaded

const
    car_1 = 28@
    car_2 = 29@
    car_3 = 30@
    car_4 = 31@
    car_find = 10@
    find = 27@
    choise = 25@
end

choise = 0

repeat
wait 0

    find = 0
    while 0EA8: get_any_car_no_save_recursive find progress_to find car_to car_find (choise,1i)

        if or
            003B:   car_find (choise,1i) == car_1  // (int)
            003B:   car_find (choise,1i) == car_2  // (int)
            003B:   car_find (choise,1i) == car_3  // (int)
            003B:   car_find (choise,1i) == car_4  // (int)
        then
            if and
                not locate_car_distance_to_coordinates car_find (choise,1i) pos -2694.7952 1273.855 55.4297 radius 3.0
                not locate_car_distance_to_coordinates car_find (choise,1i) pos -2686.4033 1273.7784 55.4297 radius 3.0
                not locate_car_distance_to_coordinates car_find (choise,1i) pos -2677.0002 1272.7784 55.4297 radius 3.0
                not locate_car_distance_to_coordinates car_find (choise,1i) pos -2668.0251 1272.7784 55.4297 radius 3.0
            then
                if choise == 0
                then car_1 = -1
                end
                if choise == 1
                then car_2 = -1
                end
                if choise == 2
                then car_3 = -1
                end
                if choise == 3
                then car_4 = -1
                end
            end
            continue
        end

        if or
            0EEB: locate_car_distance_to_coordinates car_find (choise,1i) pos -2694.7952 1273.855 55.4297 radius 3.0
            0EEB: locate_car_distance_to_coordinates car_find (choise,1i) pos -2686.4033 1273.7784 55.4297 radius 3.0
            0EEB: locate_car_distance_to_coordinates car_find (choise,1i) pos -2677.0002 1272.7784 55.4297 radius 3.0
            0EEB: locate_car_distance_to_coordinates car_find (choise,1i) pos -2668.0251 1272.7784 55.4297 radius 3.0
        then
            046C: 0@ = car car_find (choise,1i) driver
            if and
                01C1:   car car_find (choise,1i) stopped
                0@ > 0
            then
                if and
                    8611: not  actor 0@ performing_animation "pay_bridge"
                    8118: not  actor 0@ dead
                then
                    0A1A: actor 0@ perform_walk_animation "pay_bridge" IFP "PedEventsMod" framedelta 2.0 loopA 0 lockX 0 lockY 0 lockF 0 -1 ms // versionC
                    0085: car_1 (choise,1i) = car_find (choise,1i) // (int)
                    choise += 1
                    if choise > 3
                    then choise = 0
                    end
                    wait 300
                    continue
                end
            end
        end
    end
until not locate_char_distance_to_coordinates $player_actor pos -2677.0002 1272.7784 55.4297 radius 65.0

04EF: release_animation "PedEventsMod"
0A93: terminate_this_custom_script
